@extends('layouts.header')
@inject('sender','App\Http\Controllers\WroteitController')
@section('content')
    <h2 style="text-align: left;">Inbox</h2>
    @foreach($messages as $message)
        @if (Auth::user()->id == $message->to_id)
            <h4 style="text-align: center;"><a href="{{ route('show_message',['mes'=>$message->id]) }} " title="Show message">{{$message->title}}</a> from {{$sender::getSender($message)->name}} 
            at {{$message->created_at}}</h4>
        @endif
    @endforeach
@endsection()